package pkg06.excepciones;

import java.io.FileWriter;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Excepciones {
    private static Logger logger = Logger.getLogger(Excepciones.class.getName());

    public static void main(String[] args) {
        System.out.println("1");
        try {
            f1();
            System.out.println("2");
        } catch (ArithmeticException e) {
            System.out.println("3.1");
        } catch (Exception e) {
            System.out.println("3.2");
            e.printStackTrace();
            logger.log(Level.SEVERE, "Mensaje descriptivo",e);
        }
        System.out.println("4");
    }

    private static void f1()  throws IOException {
        f2();
    }

    private static void f2() throws IOException {
        Object o = null;
        o.toString();
        int a = 0;
         int b = 3 / a;
         new FileWriter("dfsd");
         

    }
}
